#include "Global.h"

namespace Object
{

	std::ostream& BaseT<char>::fillSelfOs(std::ostream& os) const
	{
		using CompDef = Component::FillOs::Define;
		uint8_t osFormat = 0;
		auto pCld = getCld<CompDef>();
		auto objIt = pCld->begin();
		if (objIt != pCld->end())
		{
			auto pDef = dynamic_cast<const CompDef*>(objIt->second);
			if (pDef)
				osFormat = pDef->_format;
		}

		switch (osFormat)
		{
		case 1:
			return os << _t;
		case 2:
			return os << "'\\" << std::setfill('0') << std::setw(3) << (size_t)_t << "'";
		case 3:
			return os << (size_t)_t;
		default:
			break;
		}

		return Base::fillSelfOs(os) << "char,t=[" << _t << "'\\" << std::setfill('0') << std::setw(3) << (size_t)_t << "']";
	}
}
